#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <set>

using namespace std;

long countChords(int n)
{
    if (n < 0 || n % 2 != 0)
        return 0;
    int len = n / 2 + 1;
    long c[len];
    c[0] = c[1] = 1;
    for (int i = 2; i < len; ++i)
    {
        int sum = 0;
        for (int j = 0; j < i; j++)
            sum += c[j] * c[i-1-j];
        c[i] = sum;
    }
    return c[len-1];
}

int Cal(int n){
if (n % 2 == 1) return 0;
if (n == 0) return 1;
if (n==2) return 1;
int sum = 0;
for (int i = 0; i < n; i = i+2)
{
sum += Cal(i) * Cal(n-i-2);
}
return sum;
}


/*
Here is a shot at a different way to see this problem. If you connect any two points, the circle is partitioned into two arcs, each arc has a certain number of points. For the remaining points, you could only connect those that are on the same arc, otherwise, lines will intersect. Take ten points {1,2, …, 10} for an example. For point 1, you could connect it to 9 other points. However, only 5 of them are valid, i.e., points 2, 4, 6, 8, , and 10. If you connect point 1 to 3, then, you are left with two groups of odd number of points, {2} and {4,5,6,7,8, 9,10}, which are invalid. Let f(n) denote the number of ways to draw n non intersecting chords. For n = 10:

f(10) = f(0)*f(8)+f(2)*f(6)+f(4)*f(4)+f(6)*f(2)+f(8)*f(0)

From here, we could derive a recurrence relationship as the one by daidongLY (adding f(0) = 1 as a base case). I included daidongLY's code as follows with minor modifications.
*/

int draw(int num)
{
    if (num == 0) return 1;
    if (num == 2) return 1;
    if (num% 2 == 0) return 0;
    if (num <= 1) return 0;
    int ways= 0;
    for (int i = 2; i <= num; i++) {
       ways += draw(i)*draw(num-i); 
    }
    cout << num << " " << ways << endl;
    return ways;
}

int main(int argc, char **argv)
{
    cout << Cal(6) << endl;
}
